<tr data-id="{{$user->id}}">
    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">{{ $user->id }}</td>
    <td class="px-6 py-4 whitespace-nowrap">
        <div class="flex items-center">
            <div class="flex-shrink-0 h-10 w-10 bg-gray-200 dark:bg-gray-600 rounded-full flex items-center justify-center">
                <span class="text-gray-700 dark:text-gray-300 font-medium">{{ substr($user->name, 0, 1) }}</span>
            </div>
            <div class="ml-4">
                <div class="text-sm font-medium text-gray-900 dark:text-white">{{ $user->name }}</div>
            </div>
        </div>
    </td>
    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">{{ $user->email }}</td>
    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
        @foreach($user->roles as $role)
            <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100">
                                            {{ $role->name }}
                                        </span>
        @endforeach
    </td>
    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">{{ $user->created_at->format('Y-m-d H:i') }}</td>
    <td class="px-6 py-4 whitespace-nowrap">
                                    <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100">
                                        活跃
                                    </span>
    </td>
    <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
        <div class="flex justify-end space-x-2">
            <a class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300"
                    hx-get="{{route('admin.user.update', ['user' => $user['id']])}}"
                    href="{{route('admin.user.update', ['user' => $user['id']])}}"
                    hx-target="#modal-body"
                    hx-swap="innerHTML"
                    hx-push-url="false"
                    data-open-model="true"
                    x-data
            >
                编辑
            </a>
            <a hx-push-url="false" hx-delete="{{route('admin.user.delete', ['user' => $user['id']])}}" hx-target="closest tr" hx-swap="delete" href="{{route('admin.user.delete', ['user' => $user['id']])}}" class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
                删除
            </a>
        </div>
    </td>
</tr>
